//spu相关的api接口所在的对象
import request from '@/utils/request'
//公共地址
const api_name ='/admin/product'
export default {
//获取所有销售属性
getBaseSaleAttrList(){
    return request.get(`${api_name}/baseSaleAttrList`)
},
//根据spuid删除某个spuInfo对象
deleteSpuInfoById (spuId){
    return  request.delete(`${api_name}/deleteSpu/${spuId}`)
},
//根据关键字获取spuInfo对象列表数据
findSpuInfoByKeyword(keyword){
    return  request.get(`${api_name}/findSpuInfoByKeyword/${keyword}`)
},
//根据有spuid获取获取对应的souinfo对象数据
getSpuInfoById(spuId){
    return  request.get(`${api_name}/getSpuById/${spuId}`)
},
// 根据多个spuId获取对应的spuInfo对象列表
findSpuInfoBySpuIdList(spuIdList){
    return  request.post(`${api_name}/inner/findSpuInfoBySpuIdList`,spuIdList)
},
//添加或修改spuInfo
addOrUpdateSpuInfo(spuInfo){
    return  request.post(`${api_name}/${spuInfo.id?'updateSpuInfo':'saveSpuInfo'}`,spuInfo)
},
//获取spuInfo列表分页形式
getSpuInfoList(page,limit,category3Id){
    return  request.get(`${api_name}/${page}/${limit}`,{params:{category3Id}})
    //return request({
    // url:`${api_name}/${page}/${limit}`,
    //method:'GET',
    //params:{category3Id}
    //})
}
}



























// GET /admin/product/baseSaleAttrList
// getBaseSaleAttrList

// DELETE /admin/product/deleteSpu/{spuId}
// deleteSpu

// GET /admin/product/findSpuInfoByKeyword/{keyword}
// findSpuInfoByKeyword

// GET /admin/product/getSpuById/{spuId}
// 获取spu基本信息

// POST /admin/product/inner/findSpuInfoBySpuIdList
// findSpuInfoBySpuIdList

// POST /admin/product/saveSpuInfo
// saveSpuInfo

// POST /admin/product/updateSpuInfo
// 更改spu信息

// GET /admin/product/{page}/{limit}
// index

